//状态
function state(x, y, label) {
    var cell = new joint.shapes.fsa.State({
        position: {x: x, y: y},
        size: {width: 60, height: 60},
        attrs: {
            text: {text: label, fill: '#000000', 'font-weight': 'normal'},
            'circle': {
                fill: '#f6f6f6',
                stroke: '#000000',
                'stroke-width': 2
            }
        }
    });
    return cell;
}


//var graph = new joint.dia.Graph;

//var paper = new joint.dia.Paper({
//    el: $('#chart'),
//    snapLinks: true,
//    linkPinning: false,
//    defaultLink: new joint.shapes.logic.Wire,
//    model: graph
//}).on({
//        'cell:pointerup': function (cellView) {
//
//            // We don't want a Halo for links.
//            if (cellView.model instanceof joint.dia.Link) return;
//
//            var halo = new joint.ui.Halo({cellView: cellView});
//            halo.render();
//            halo.on('action:link:add',function(){
//                console.log('sdf');
//            });
//        },
//        'cell:pointerdblclick':function(cellview){
//            if (!activeSubflow && !d.changed) {
//                if (d._def.button.toggle) {
//                    d[d._def.button.toggle] = !d[d._def.button.toggle];
//                    d.dirty = true;
//                }
//                if (d._def.button.onclick) {
//                    d._def.button.onclick.call(d);
//                }
//                if (d.dirty) {
//                    redraw();
//                }
//            } else if (d.changed) {
//                RED.notify(RED._("notification.warning", {message:RED._("notification.warnings.undeployedChanges")}),"warning");
//            } else {
//                RED.notify(RED._("notification.warning", {message:RED._("notification.warnings.nodeActionDisabled")}),"warning");
//            }
//            d3.event.preventDefault();
//        }
//    });




